package main.java.decorator;

/**
 * 装饰者模式
 */
public class Demo {
    public static void main(String[] args) {
        FastFood food = new FriedRice();
        System.out.println(food.getDesc() + "  " + food.cost() + "元");

        FastFood addEgg = new Egg(food);
        System.out.println(food.getDesc() + " " + addEgg.cost() + "元");

        FastFood food2 = new FriedNoodles();
        FastFood addBacon = new Bacon(food2);
        System.out.println(food2.getDesc() + " " + addBacon.cost() + "元");


    }
}
